/*
 * Number.cpp
 *
 *  Created on: 17.04.2012
 *      Author: Eugene Kornykhin
 */

#include "Number.h"
#include <sstream>
using namespace std;

Number::Number(int value) : value(value) {
}

Number::~Number() {
}

int Number::getValue() const {
	return value;
}

void Number::execute(Interpreter& interpreter) {
	interpreter.pushPolizElement(*this);
}

PolizPosition Number::next_position_after(PolizPosition p) const {
	return p.next();
}

bool Number::isHalt() const {
	return false;
}

Number* Number::clone(const Poliz &) const {
	return new Number(value);
}


string Number::toString() const {
	stringstream s; s << value;
	return "[" + s.str() + "]";
}
